-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add Nonce attribute of IssueAsset Transaction #385
base: master
Are you sure you want to change the base?
Conversation
return nil | ||
} | ||
|
||
func (a *IssueAsset) Deserialize(r io.Reader, version byte) error { | ||
var err error | ||
a.Nonce, err = serialization.ReadUint64(r) | ||
if err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cannot judge to err, return err directly.
@@ -14,9 +18,18 @@ func (a *IssueAsset) Data(version byte) []byte { | |||
} | |||
|
|||
func (a *IssueAsset) Serialize(w io.Writer, version byte) error { | |||
err := serialization.WriteUint64(w, a.Nonce) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cannot judge to err, return err directly.
return serialization.WriteUint64(w, a.Nonce)
Signed-off-by: zhengq1 <[email protected]>
31f316a
to
8dd808b
Compare
got it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is already a nonce existed in the Transaction header, it looks duplicate to add another nonce field in the payload
Nonce in transaction struct is reserved for balance model, if use UTXO model, transaction which need nonce can add it to payload. |
agree with zhengq1, this nonce is used to allow issuer to create multiple issue transaction with the just same value. |
Signed-off-by: zhengq1 [email protected]